export const transStr = function (obj) {
	let arr = []
	Object.keys(obj).map((key, index)=> {
		arr[index] = key + '=' + obj[key]
	})
	return arr.join('&')
}
export const time = function () {
	let data = new Date()
	let year = data.getFullYear()
	let month = data.getMonth() + 1
	let gdate = data.getDate()
	let hours = data.getHours() < 10 ? '0' + data.getHours(): data.getHours()
	let min = data.getMinutes() < 10 ? '0' + data.getMinutes(): data.getMinutes()
	let sec = data.getSeconds() < 10 ? '0' + data.getSeconds(): data.getSeconds()
	return `${year}年${month}月${gdate}日 ${hours}:${min}:${sec}`
}
export const npcFresch = function () {
	let obj;
	let num = Math.round(1+Math.random()*100)
	if(num < 10) {
		obj = {
				id:1,
				name:'初级宝宝云亭仙',
				xue: 15,
				zhua: true,
				gong: 5
		}
	}
	if (55 >= num && num >= 10 ) {
		obj = {
				id:1,
				name:'青蛙',
				xue: 4,
				zhua: false,
				gong: 1
		}
	}
	if (100 >= num && num > 55) {
		obj = {
				id:1,
				name:'蝴蝶',
				xue: 4,
				zhua: false,
				gong: 1
		}
	}
	return obj
}
